package com.itheima.bos.web.action;

import java.util.List;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.itheima.bos.domain.base.TakeTime;
import com.itheima.bos.service.TakeTimeService;
import com.itheima.bos.web.action.common.BaseAction;

@ParentPackage(value="json-default")
@Namespace("/takeTime")
@Controller
@Scope("prototype")
public class TakeTimeAction extends BaseAction<TakeTime> {

	@Autowired
	private TakeTimeService takeTimeService;
	
	@Action(value="takeTime_findAll",results={@Result(name="success",type="json")})
	public String takeTime_findAll(){
		List<TakeTime> list = takeTimeService.findAll();
		ServletActionContext.getContext().getValueStack().push(list);
		return SUCCESS;
	}
}
